package com.jmb.api.custom.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.BitSet;

@Configuration
public class Knife4jConfiguration {
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI().info(
                new Info().title("API接口文档").version("1.0.0"));
    }
    @Bean
    public GroupedOpenApi LoginUserAPI(){
        return GroupedOpenApi.builder()
                .group("登录管理")
                .pathsToMatch("/user/login/**").build();
    }
    @Bean
    public GroupedOpenApi RoleAPI(){
        return GroupedOpenApi.builder()
                .group("角色管理")
                .pathsToMatch("/role/**").build();
    }
    @Bean
    public GroupedOpenApi UserAPI(){
        return GroupedOpenApi.builder()
                .group("用户管理")
                .pathsToMatch("/user/**").build();
    }
    @Bean
    public GroupedOpenApi PermissionAPI(){
        return GroupedOpenApi.builder()
                .group("权限管理")
                .pathsToMatch("/permission/**").build();
    }
    @Bean
    public GroupedOpenApi ProjectAPI(){
        return GroupedOpenApi.builder()
                .group("项目管理")
                .pathsToMatch("/project/**").build();
    }
    @Bean
    public GroupedOpenApi ModuleAPI(){
        return GroupedOpenApi.builder()
                .group("模块管理")
                .pathsToMatch("/module/**").build();
    }
    @Bean
    public GroupedOpenApi ApiAPI(){
        return GroupedOpenApi.builder()
                .group("权限项目管理")
                .pathsToMatch("/role/permission/**").build();
    }
    @Bean
    public GroupedOpenApi LoginLogAPI(){
        return GroupedOpenApi.builder()
                .group("登录日志管理")
                .pathsToMatch("/user/login/log/**").build();
    }
   @Bean
    public GroupedOpenApi systemApi(){
        return GroupedOpenApi.builder()
                .group("系统管理")
                .pathsToMatch("/system/**").build();
   }
   @Bean
    public GroupedOpenApi ApiTest(){
        return GroupedOpenApi.builder()
                .group("接口测试")
                .pathsToMatch("/api/test/**").build();
   }
}
